package com.cuit.dashboard.system.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.cuit.dashboard.system.entity.SysAdminEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;


/**
 * @program: hulu-dashboard
 * @description:
 * @author: KamTang
 * @create: 2022-06-11 17:25
 **/
public interface SysAdminDao extends BaseMapper<SysAdminEntity> {

    /**
     * 根据username查询
     * @param username 用户名
     * @return AdminEntity
     */
    SysAdminEntity queryByUsername (@Param("username") String username);

    /**
     * 根据id查询所有权限
     * @param userId
     * @return
     */
    List<String> queryAllPermsById(@Param("userId") Long userId);

    /**
     * 根据用户id获取该用户的所有菜单id
     * @param userId
     * @return
     */
    List<Long> getMenuIdByUserId(@Param("userId") Long userId);

    /**
     * 分页查询管理员
     * @param params 前端传来的参数Map
     * @return
     */
    List<SysAdminEntity> queryAdmin(Map<String, Object> params);
}
